/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.dfg.twittersneps.modelo;

import java.util.Hashtable;

/**
 *
 * @author Franco
 */
public class Ngrams {

    private Hashtable hashUngram;
    private Hashtable hashBigram;
    private Hashtable hashTrigram;

    public Ngrams(){
        this.hashUngram = new Hashtable();
        this.hashBigram = new Hashtable();
        this.hashTrigram = new Hashtable();

    }

    public void addUngrams(String ngram,int contador){
        this.hashUngram.put(ngram, contador);

    }

    public void addBigrams(String ngram,int contador){
        this.hashBigram.put(ngram, contador);

    }

    public void addTrigrams(String ngram,int contador){
        this.hashTrigram.put(ngram, contador);
    }

    public int getUngrams(String ngram){
        return (Integer)this.hashUngram.get(ngram);
    }

    public int getBigrams(String ngram){
        return (Integer)this.hashBigram.get(ngram);
    }

    public int getTrigrams(String ngram){
        return (Integer)this.hashTrigram.get(ngram);
    }

    public boolean buscarUngram(String ungram){
       return this.hashUngram.containsKey(ungram);
    }

    public boolean buscarBigram(String bigram){
        return this.hashBigram.containsKey(bigram);
    }

    public boolean buscarTrigram(String trigram){
        return this.hashTrigram.containsKey(trigram);
    }

    public Hashtable getTablaUngram(){
        return this.hashUngram;
    }

    public Hashtable getTablaBigram(){
        return this.hashBigram;
    }

    public Hashtable getTablaTrigram(){
        return this.hashTrigram;
    }

}
